﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 人员管理
{
    // 实现双向绑定
    public class Form1Model: BaseModel
    {
        private string? _name;
        private string? _age;
        private string? _sex;
        private string? _addr;

        private IEnumerable<Person> _persons;


        public long SelId { get; set; }

        public string Name 
        { 
            get { return _name; }
            set 
            { 
                _name = value;
                OnPropertyChanged("Name");
                //SetProperty(ref _name,value,"Name");

            }
        }
        public string Age 
        {
            get
            { 
                return _age;
            }
            set 
            { 
                _age = value;
                OnPropertyChanged("Age");
                //SetProperty(ref _age,value,_age);
            }
        }
        public string Sex
        {
            get
            {
                return _sex;
            }
            set
            {
                _sex = value;
                OnPropertyChanged("Sex");
                //SetProperty(ref _sex,value,_sex);
            }
        
        }
        public string Addr {  
            get 
            {
                return _addr;
            } set {
                _addr = value;
                OnPropertyChanged("Addr");
                //SetProperty(ref _addr,value,_addr);
            } 
        }

        public IEnumerable<Person> Persons
        {
            get
            {
                return _persons;
            }
            set
            {
                _persons = value;
                OnPropertyChanged("Persons");
            }
        }
    }
}
